package com.eastfair.pay.dto;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import com.eastfair.core.base.entity.SuperEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 实体类
 * 合同
 * </p>
 *
 * @author clm
 * @since 2022-06-08
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = false)
@Builder
@ApiModel(value = "ContractDTO", description = "合同")
public class ContractDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键")
    @NotNull(message = "请填写主键", groups = SuperEntity.Update.class)
    private Long id;
    /**
     * 项目id
     */
    @ApiModelProperty(value = "项目id")
    private Long projectId;
    /**
     * 子系统id
     */
    @ApiModelProperty(value = "子系统id")
    private Long subsystemId;
    /**
     * 租户id
     */
    @ApiModelProperty(value = "租户id")
    private Long tenantId;
    /**
     * 系统code
     */
    @ApiModelProperty(value = "系统code")
    @Size(max = 20, message = "系统code长度不能超过20")
    private String systemCode;
    /**
     * 业务系统主键
     */
    @ApiModelProperty(value = "业务系统主键")
    @NotNull(message = "请填写业务系统主键")
    private Long contractId;
    /**
     * 合同编号
     */
    @ApiModelProperty(value = "合同编号")
    @Size(max = 20, message = "合同编号长度不能超过20")
    private String contractNumber;
    /**
     * 合同名称
     */
    @ApiModelProperty(value = "合同名称")
    @Size(max = 50, message = "合同名称长度不能超过50")
    private String contractName;
    /**
     * 展会id
     */
    @ApiModelProperty(value = "展会id")
    private Long exhibitionId;
    /**
     * 展会名称
     */
    @ApiModelProperty(value = "展会名称")
    @Size(max = 255, message = "展会名称长度不能超过255")
    private String exhibitionName;
    /**
     * 合同金额
     */
    @ApiModelProperty(value = "合同金额")
    private BigDecimal contractAmount;
    /**
     * 乙方id(按客户名称查询如库里有则不为空)
     */
    @ApiModelProperty(value = "乙方id(按客户名称查询如库里有则不为空)")
    private Long cutomerId;
    /**
     * 乙方名称
     */
    @ApiModelProperty(value = "乙方名称")
    @Size(max = 255, message = "乙方名称长度不能超过255")
    private String cutomerName;
    /**
     * 乙方法人代表
     */
    @ApiModelProperty(value = "乙方法人代表")
    @Size(max = 255, message = "乙方法人代表长度不能超过255")
    private String customerLegal;
    /**
     * 乙方统一代码
     */
    @ApiModelProperty(value = "乙方统一代码")
    @Size(max = 20, message = "乙方统一代码长度不能超过20")
    private String customerUscc;
    /**
     * 乙方地址
     */
    @ApiModelProperty(value = "乙方地址")
    @Size(max = 255, message = "乙方地址长度不能超过255")
    private String customerAddress;
    /**
     * 开始时间
     */
    @ApiModelProperty(value = "开始时间")
    private LocalDateTime startTime;
    /**
     * 结束时间
     */
    @ApiModelProperty(value = "结束时间")
    private LocalDateTime endTime;
    /**
     * 签单日期
     */
    @ApiModelProperty(value = "签单日期")
    private LocalDateTime signingTime;
    /**
     * 我方签单人
     */
    @ApiModelProperty(value = "我方签单人")
    @Size(max = 255, message = "我方签单人长度不能超过255")
    private String signatoryName;
    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    @Size(max = 255, message = "备注长度不能超过255")
    private String remark;
    /**
     * 合同url
     */
    @ApiModelProperty(value = "合同url")
    @Size(max = 255, message = "合同url长度不能超过255")
    private String contractUrl;
    /**
     * 已开票金额
     */
    @ApiModelProperty(value = "已开票金额")
    @TableField(value = "invoiced_amount")
    @Excel(name = "已开票金额")
    private BigDecimal invoicedAmount;

    /**
     * 合同付款状态
     */
    @ApiModelProperty(value = "合同付款状态")
    @TableField(value = "contract_pay_state")
    @Excel(name = "合同付款状态")
    private String contractPayState;

    /**
     * 场地保证金
     */
    @ApiModelProperty(value = "场地保证金")
    @TableField(value = "space_bond")
    @Excel(name = "场地保证金")
    private BigDecimal spaceBond;

    /**
     * 服务预存款
     */
    @ApiModelProperty(value = "服务预存款")
    @TableField(value = "service_bond")
    @Excel(name = "服务预存款")
    private BigDecimal serviceBond;

    /**
     * 场地费用
     */
    @ApiModelProperty(value = "场地费用")
    @TableField(value = "space_amount")
    @Excel(name = "场地费用")
    private BigDecimal spaceAmount;

    /**
     * 合同回款金额
     */
    @ApiModelProperty(value = "合同回款金额")
    @TableField(value = "contract_returnd_amount")
    @Excel(name = "合同回款金额")
    private BigDecimal contractReturndAmount;

    /**
     * 付款计划
     */
    private List<PaymentPlanDTO> paymentPlanDTOList;

}
